package com.itheima.health.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.itheima.health.dao.MenuDao;
import com.itheima.health.dao.RoleDao;
import com.itheima.health.dao.UserDao;
import com.itheima.health.pojo.Role;
import com.itheima.health.pojo.User;
import com.itheima.health.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * @autahor: csl
 * @date: 2019/7/26
 * @description:
 * @version:1.0
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;
    @Autowired
    private RoleDao roleDao;
    @Autowired
    private MenuDao menuDao;
    @Override
    public boolean login(String username, String password) {
       if ("admin".equals(username)&&"123".equals(password)){
           return true;
       }
        return false;
    }

    @Override
    public User findByUsername(String username) {
        User user = userDao.findByUsername(username);
        System.out.println(user);
        return user;
    }

}
